﻿using L7_Modularity.ModuleA.ViewModels;
using L7_Modularity.ModuleA.Views;
using Prism.Ioc;
using Prism.Modularity;
using Prism.Navigation.Regions;

namespace L7_Modularity.ModuleA;

public class ModuleAModule : IModule
{
    public void RegisterTypes(IContainerRegistry containerRegistry)
    {
        containerRegistry.RegisterDialog<ShowMessageDialog, ShowMessageDialogViewModel>();
        containerRegistry.RegisterForNavigation<ModuleAMainView>();
        containerRegistry.RegisterForNavigation<ModuleAContentView>();
    }

    public void OnInitialized(IContainerProvider containerProvider)
    {
        IRegionManager regionManager = containerProvider.Resolve<IRegionManager>();
        regionManager.RegisterViewWithRegion("ContentRegion", "ModuleAMainView");
        regionManager.RegisterViewWithRegion("ModuleAMainContentRegion", "ModuleAContentView");
    }
}